#ifndef TRANSPARENCYHELPER_H
#define TRANSPARENCYHELPER_H

#include <windows.h>
#include <set>
#include <map>

class TransparencyHelper;

#include "CassiopeiaComponent.h"
#include "Utilities.h"

using namespace std;

class TransparencyHelper
{
public:
	TransparencyHelper();
	~TransparencyHelper();
	void ToggleTransparentOnLeave(HWND hWnd);
	bool IsTransparentOnLeave(HWND hWnd);
	void ToggleTransparentOnMoveSize();
	bool IsTransparentOnMoveSize();
	void ToggleExcludeFromTransparentOnMoveSize(HWND hWnd);
	bool IsExcludedFromTransparentOnMoveSize(HWND hWnd);
	void SetWindowTransparency(HWND hWnd, BYTE alpha);
private:
	map<HWND, BYTE> transparentOnLeaveHWnds;
	set<HWND> excludeFromTransparentOnMoveSizeHWnds;
	bool transparentOnMoveSize;

	void MakeInactiveWindowsTransparent(HWND foregroundHWnd);
	void ResetTransparentOnLeaveWindows();


	static set<TransparencyHelper*> instances;
	static HWINEVENTHOOK hWinEventHook;

	static VOID CALLBACK WinEventProc(HWINEVENTHOOK hWinEventHook,DWORD dwEvent,HWND hWnd,LONG idObject,LONG idChild,DWORD idEventThread,DWORD dwmsEventTime);

};

#endif